package org.lqq.serverRegisterAndFinder.serverFinder.eureka;

import com.netflix.appinfo.AbstractInstanceConfig;
import com.netflix.appinfo.DataCenterInfo;

import java.util.LinkedHashMap;
import java.util.Map;

/**
 * Created by 李清泉 on 2017/11/1.
 *
 * @remark
 */
public class MyEurekaInstaceConfig extends AbstractInstanceConfig{
    @Override
    public String getInstanceId() {
        return "test-eureka:8888";
    }

    @Override
    public String getAppname() {
        return "test-eureka";
    }

    @Override
    public String getAppGroupName() {
        return "unknown";
    }

    @Override
    public boolean isInstanceEnabledOnit() {
        return true;
    }

    @Override
    public int getNonSecurePort() {
        return 80;
    }

    @Override
    public int getSecurePort() {
        return 443;
    }

    @Override
    public boolean isNonSecurePortEnabled() {
        return true;
    }

    @Override
    public boolean getSecurePortEnabled() {
        return false;
    }

    @Override
    public int getLeaseRenewalIntervalInSeconds() {
        return 30;
    }

    @Override
    public int getLeaseExpirationDurationInSeconds() {
        return 90;
    }

    @Override
    public String getVirtualHostName() {
        return getAppname();
    }

    @Override
    public String getSecureVirtualHostName() {
        return getAppname();
    }

    @Override
    public String getASGName() {
        return null;
    }



    @Override
    public Map<String, String> getMetadataMap() {
        Map<String,String> map = new LinkedHashMap<String, String>();
        map.put("instanceId","test:33");
        return map;
    }

    @Override
    public DataCenterInfo getDataCenterInfo() {
        return new DataCenterInfo() {
            @Override
            public Name getName() {
                return Name.MyOwn;
            }
        };
    }



    @Override
    public String getStatusPageUrlPath() {
        return null;
    }

    @Override
    public String getStatusPageUrl() {
        return null;
    }

    @Override
    public String getHomePageUrlPath() {
        return null;
    }

    @Override
    public String getHomePageUrl() {
        return null;
    }

    @Override
    public String getHealthCheckUrlPath() {
        return null;
    }

    @Override
    public String getHealthCheckUrl() {
        return null;
    }

    @Override
    public String getSecureHealthCheckUrl() {
        return null;
    }

    @Override
    public String[] getDefaultAddressResolutionOrder() {
        return new String[0];
    }

    @Override
    public String getNamespace() {
        return "eureka";
    }
}
